//
//  CAddressListView.h
//  HCHK_iphone
//
//  Created by yilong zhang on 12-1-12.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "CUploadPageCtrl.h"
#import "CLocator.h"

@class CMainPageCtrl;

//========================================================================================================================

@interface CResInfo : NSObject

@property (nonatomic, retain) NSString  *m_strName;
@property (nonatomic, retain) NSString  *m_strVici;
@property (nonatomic, assign) float     m_fLat;
@property (nonatomic, assign) float     m_fLon;
@property (nonatomic, assign) int       m_nType;        //0-shoudong,1-zidong

-(id)initWithDic:(NSDictionary*)dic;
-(id)initWithName:(NSString*)name;

@end

//========================================================================================================================

@interface CAddr : NSObject

@property (nonatomic, retain) NSString  *m_Detail;
@property (nonatomic, retain) NSString  *m_Country;
@property (nonatomic, retain) NSString  *m_Province;
@property (nonatomic, retain) NSString  *m_City;
@property (nonatomic, retain) NSString  *m_X;
@property (nonatomic, retain) NSString  *m_Y;

@end

//========================================================================================================================

@protocol AddressListDelegate <NSObject>

@optional
-(void)DidAddressListViewActived:(UIView*)view Command:(int)command Value1:(id)value1 Value2:(id)value2;

@end

//========================================================================================================================

@interface CAddressListView : UIView <UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource, NetWorkRequestDelegate>

@property (nonatomic, assign) id<AddressListDelegate>   delegate;

@property (nonatomic, assign) UINavigationBar       *m_Bar;
@property (nonatomic, assign) UISegmentedControl    *m_Seg;
@property (nonatomic, assign) UITableView           *m_List;

@property (nonatomic, retain) CAddr         *m_Addr;
@property (nonatomic, assign) NSMutableArray*m_Contents;

@property (nonatomic, assign) int           m_ShowStyle;           //0-resname,1-adress,2-all(resname),3-all(addr)

-(void)UpDateAddrList;
-(void)CancelSelected;
-(void)GetCurPosition;
-(void)UpdatePosition:(NSNotification*)notification;
-(void)LoadPositions;
-(void)GetPointRoundInfo:(CLLocationCoordinate2D)coordinate;

-(void)SaveResInfo;
-(void)GetResInfo;

@end
